#include<iostream>
#include<stack>
using namespace std;
int main()
{
	stack<int> a1;
	a1.push(1);
	a1.push(12);
	a1.push(13);
	a1.push(14);
	a1.push(16);

	while (!a1.empty())
	{
		cout << a1.top() << " ";
		a1.pop();
	}
	cout << endl;

	return 0;
}